<?php
$sql= "
        SELECT
                products.products_id,
                products_model,
                products_ean,
                products_description.products_name,
                manufacturers.manufacturers_name,
                products_description.products_description,
                products_price, products_quantity,
                products_ASIN, products_image,
                products_weight,
                ams_browse_node1,
                ams_browse_node2,
                products_search1,
                products_search2,
                products_search3,
                products_search4,
                products_search5,
                products_leadtime_to_ship
        FROM products
        JOIN products_description ON products.products_id = products_description.products_id
        JOIN products_to_categories ON products.products_id = products_to_categories.products_id
        JOIN categories ON products_to_categories.categories_id = categories.categories_id
        LEFT JOIN manufacturers ON products.manufacturers_id = manufacturers.manufacturers_id
        WHERE (
                products_ean IS NOT NULL
                AND products_ean != ''
        )
        OR (
                products_ASIN IS NOT NULL
                AND products_ASIN != ''
        )
";

mysql_connect($server, $login, $password);
mysql_select_db($db);
?>